//Name: Quest Giver
//Author:Max Charnock
//Last Updated: 16/05/2014
//Purpose: charcter which manages the quests and gives quests to the player.

#pragma once

#include "Globals.h"		
#include "d3dUtil.h"		
#include "GraphicsInterface.h"
#include "AnimatedModel.h"
#include "AbstractQuest.h"
#include "Terrain.h"
#include <vector>

// The file path of the animated NPC model we are using
#define NPC_MODEL_FILE_PATH "AnimModels/boblampclean.md5mesh"
// Where we find the model's textures. 
#define NPC_MODEL_TEXTURE_FILE_PATH "AnimModels/"

class QuestGiver
{
private:

	//quest givers model used for rendering and keeping track of positon
	AnimatedModel* NPCModel;
	// Pointer to the terrain class
	Terrain* terrain;

	//vector of quests the NPC can give
	std::vector<AbstractQuest*> Quests;

	float radius; 

public:

	QuestGiver();
	~QuestGiver();

	void AddToBatch(GraphicsInterface* gi);

	//function used to set quest givers position and to set up quests
	void Intialise(ID3D11Device* device, 
							XMFLOAT3 position, 
							XMFLOAT3 rotation, 
							XMFLOAT3 scale,
							Terrain* gameTerrain);

	//virtual fucntion used to update the enemies values
	void Update(float delta, bool shouldLoop, bool riggedPose);

	//returns a uncompleted quest to theplayer so that they can complete it
	AbstractQuest* GiveQuest();

	//add a quest to the quest vector
	void AddQuest(AbstractQuest* quest);

	XMFLOAT3 GetPosition();

	float GetRadius();

};
